<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="utf-8">
    <style type="text/css">
        #content,#box{
            width: 600px;
            height: 50px;
            line-height: 50px;
            border: 1px solid #000;
            font-size: 30px;
        }
    </style>
</head>
<body>
    <h1>JS 表单其他事件</h1>
    <hr>

    <h2>实时显示输入文本</h2>

    <input type="text" id="content">
    <br>
    <br>
    <br>
    <div id="box"></div>
</body>
<script>
     var input = document.getElementById("content");
     var div = document.getElementById("box");


     input.oninput = demo;
     input.onpropertychange = demo;


     function demo(){
        div.innerHTML = input.value;
     }

     input.onselect = function(){
        alert(this.value);
     }
</script>
</html>